package com.bai.localshop.pojo.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.PositiveOrZero;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 代金券更新DTO（接收前端保存参数）
 */
@Data
public class VoucherUpdateDTO {
    @NotNull(message = "代金券ID不能为空")
    private Long id;

    @NotBlank(message = "代金券标题不能为空")
    private String title;

    private String subTitle;

    private String rules;

    @NotNull(message = "支付金额不能为空")
    @PositiveOrZero(message = "支付金额不能为负数")
    private Long payValue;

    @NotNull(message = "抵扣金额不能为空")
    @PositiveOrZero(message = "抵扣金额不能为负数")
    private Long actualValue;

    @NotNull(message = "代金券类型不能为空")
    private Integer type;

    @NotNull(message = "库存数量不能为空")
    @PositiveOrZero(message = "库存数量不能为负数")
    private Integer stock;

    @NotNull(message = "生效时间不能为空")
    private LocalDateTime beginTime;

    @NotNull(message = "失效时间不能为空")
    private LocalDateTime endTime;
}